<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>FAF-商家中心</title>
<link rel="stylesheet" type="text/css" href="css/reset.css">
<link rel="stylesheet" type="text/css" href="css/main2.css">
<link rel="stylesheet" type="text/css" href="css/table2.css">
<link rel="stylesheet" type="text/css" href="css/mycss.css">
<script type="text/javascript" src="js/jquery-3.3.1.js"></script>
<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>

</head>
<body>
	<div class="header_con">
		<div class="header">
			<div class="welcome fl">欢迎来到好菜，好下饭!</div>
			<div class="fr">
				<div class="login_info fl">
					欢迎您：<em>张 山</em>
				</div>
				<div class="login_btn fl">
					<a href="/FAFCode/StoreLogout">注销</a>
				</div>
				<div class="user_link fl">
					<span>|</span> <a href="#">商家中心</a> <span>|</span> <a href="#">今日订单</a>
					<span>|</span> <a href="#">历史订单</a>
				</div>
			</div>
			=
		</div>
	</div>

	<div class="search_bar clearfix">
		<a href="Index" class="logo fl"><img class="imgsize"
			src="/FAFCode/Image/logo/logo.jpg" width="80" height="80"></a>
		<div class="sub_page_name fl">|&nbsp;&nbsp;&nbsp;&nbsp;商家中心</div>
		<div class="search_con fr">
			<input type="text" class="input_text fl" name="" placeholder="搜索订单">
			<input type="button" class="input_btn fr" name="" value="搜索">
		</div>
	</div>

	<div class="main_con clearfix">
		<div class="left_menu_con clearfix">
			<h3>商家中心</h3>
			<ul>
				<li><a href="/FAFCode/PersonalInformation">· 个人信息</a></li>
				<li><a href="/FAFCode/OrderManagement/ViewOrders.jsp">·
						订单详情</a></li>
				<li><a href="/FAFCode/OrderManagement/Performance.html">·
						销售分析</a></li>
				<li><a href="/FAFCode/FoodManagement/addNewFood.jsp">· 新增菜品</a></li>
				<li><a href="/FAFCode/FoodManagement/manageFood.jsp">· 管理菜品</a></li>
				<li><a href="#" class="active">· 查看评价</a></li>
			</ul>
		</div>
		<div class="right_content clearfix">
			<h3 class="common_title2">全部评论</h3>
			<div id="comment"></div>


			<div class="pagenation" id="page"></div>
		</div>
	</div>
	<input type="text" id="storeId" name="storeId" hidden="hidden"
		value="${sessionScope.storeId}">
	<div class="footer">
		<div class="foot_link">
			<a href="#">关于我们</a> <span>|</span> <a href="#">联系我们</a> <span>|</span>
			<a href="#">招聘人才</a> <span>|</span> <a href="#">友情链接</a>
		</div>
		<p>Code-PigBang © 2020 南昌航空大学20-713</p>
		<p>电话：123654789 京ICP备996996700700号</p>
	</div>
	<script type="text/javascript">
		ffff(1);
		//加载初始化数据
		function ffff(currentPage) {
			var storeId = document.getElementById("storeId").value;
			var currentPage = currentPage;
			$("#comment").empty();
			$("#page").empty();
			$.ajax({
				type : 'post',
				data : {
					"storeId" : storeId,
					"currentPage" : currentPage
				},
				dataType : "json",
				url : "../CommentManagement",
				success : function(res) {
					$.each(res.page.resultList, function(index, obj) {
						$("#comment").append(
								"<ul class='order_list_th w978 clearfix'><li class='col01'>评价时间:"
										+ obj.commentTime
										+ "</li><li class='col02'>订单号:"
										+ obj.ordersNumber
										+ "</li><li class='col02 stress'>用户昵称:"
										+ obj.userId
										+ "</li><li class='col03'>评分:"
										+ obj.commentScore
										+ "</li></ul><table><tbody><tr><td>"
										+ obj.commentContext
										+ "</td></tr></tbody></table>");
					})

					$("#page").append(
							"	<a href='#' onclick='ffff(" + res.page.firstPage
									+ ")'>首页</a><a href='#' onclick='ffff("
									+ res.page.prePage
									+ ")'>上一页</a><a href='#' onclick='ffff("
									+ res.page.nextPage
									+ ")'>下一页</a><a href='#' onclick='ffff("
									+ res.page.lastPage + ")'>尾页</a>")
				},
				error : function() {
					alert("发生错误");
				}
			})
		}
	</script>
</body>
</html>